<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>充值 - <?php echo $cfg_webname; ?></title>
<link href="templets/style/css/reset.css" rel="stylesheet" type="text/css">
<link href="templets/style/css/member.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" src="templets/js/load.js"></script>
<script type="text/javascript">
function change(radio_oj,aValue){
   for(var i=0;i<radio_oj.length;i++){
        if(radio_oj[i].value==aValue){
            radio_oj[i].checked=true;
            break;
        }
   }
}
function Buysubmit(){
	var v=document.getElementsByName('pid')
	var j=0
	for (var i=0;i<v.length;i++){
	 if(v.item(i).checked){
	   j++
	 }
	}
	if(j<1){
		alert("请选择您要充值的面额！")
		document.f1.money.focus();
		return false;
	}else{
		var radios = document.getElementsByName("pid");
		for(var i=0;i<radios.length;i++){ 
			//判断那个单选按钮为选中状态
			if(radios[i].checked){
				if(radios[i].value==9999){
					if(document.f1.money.value < 10){
						alert("最低充值为10元，请重新输入！");
						document.f1.money.focus();
						return false;
					 }
				}
			}
		}
	}
}
</script>
</head>
<body>

<!--head-->
<?php include(DEDEMEMBER. "/templets/head.htm"); ?>


<div class="main">

<?php include(DEDEMEMBER."/templets/menu.php"); ?> 

<div class="main_right">

<div class="common_title">充值消费</div>

<div class="znxx_class">
<a href="buy.php" class="cur">充值金币</a>
<a href="recharge.php">充值记录</a>
<a href="vip.php">VIP记录</a>
<a href="operation.php">消费记录</a>
</div>
     <div class="htit">
      <ul class="fkfs">
      	<h1>付款方式：</h1>
      	<li class="alp"><label>支付宝</label></li>
		<li class="wxp"><label>微信支付</label></li>
      </ul>
     </div> 
	 
     <div class="mb_div2"> 
      <div class="mb_czfrom2 mb_czfrom2-new"> 
       <ul class="mb_cz2">
        <strong>温馨提示</strong><br />
        充值自动加金币，<strong>1元=1金币</strong>，充值以后可以马上下载，充值无使用时间限制，用完为止。
       </ul> 
       <form name="f1" action="buy_action.php" method="post" onsubmit="return Buysubmit();"> 
        <input type="hidden" name="product" value="card" /> 
        <ul>
          <?php echo $moneycards;?>
          <li><label><input name="pid" type="radio" id="radio" value="9999" checked="checked"> 充值 <span class="m-p">&yen;</span><input type="text" name="money" class="tx-shue" value="10" oninput="document.getElementById('webtest').innerHTML=this.value;" onpropertychange="document.getElementById('webtest').innerHTML=this.value;" onclick="change(document.f1.pid,'9999')" />, 可获得 <span class="m-p" id="webtest">10</span> 金币</label>，<span>最少充值10元
</span></li>
        </ul> 
		<input class="hysj_button" value="立即充值" type="submit">
        <div class="bor-b" style="margin-top:20px;"></div>
       </form> 
      </div> 
     </div> 
<form name="f1" action="buy_action.php" method="post"  id="form_pay2">
<input type="hidden" name="product" value="member" />
<ul class="hysj_jiage">
 <?php echo $membertypes?>
</ul>
<input type="hidden" name="pid" id="typeid" value="">
<input type="submit" class="hysj_button" value="立即赞助">
</form>

</div>

</div>

<!--footer-->
<?php include(DEDEMEMBER. "/templets/footer.htm"); ?>

<script>
	//会员升级
	var typeid = document.querySelector('#typeid');
	var divs = document.querySelectorAll('.hysj_jiage li div');
	for(var i=0,len=divs.length;i<len;i++){
		divs[i].onclick = divCLickHandler;
	}
	function divCLickHandler(e){
		for(var i=0,len=divs.length;i<len;i++){
			divs[i].className = '';
		}
		this.className = 'cur';
		typeid.value = this.getAttribute('_typeid');
	}
</script>
<script>
	//左边导航
	var as = document.querySelectorAll('.left_menu a');
	var spans = document.querySelectorAll('.left_menu .icons');
	for(var i=0,len=as.length;i<len;i++){
		
		spans[i].clazz = spans[i].className;
		as[i].index = i;
		as[i].onmouseenter = mouseenterHandler;
		as[i].onmouseleave = mouseleaseHandler;
	}
	function mouseenterHandler(e){
		if(!/_h$/.test(spans[this.index].clazz)){
			spans[this.index].className = spans[this.index].clazz + '_h';
		}
	}
	function mouseleaseHandler(e){
		spans[this.index].className = spans[this.index].clazz;
	}
	
	//左右等高布局
	var main_left = document.querySelector('.main_left');
	var main_right = document.querySelector('.main_right');
	if(main_left.offsetHeight<main_right.offsetHeight){
		main_left.style.height = main_right.offsetHeight + 'px';
	}
</script>

</body>
</html>